<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/25
 * Time: 12:30
 */

namespace app\admins\controller;

use think\Controller;
use Util\data\Sysdb;
//use think\Request;

class BaseAdmin extends Controller
{
    public function __construct()
    {
        // 初始化
        parent::__construct();
//        $this->request = Request::instance();

        $this->_admin = session('admin');
        // 未登录用户不允许访问
        if(!$this->_admin){
            header('location: /admins.php/admins/Account/login');
            exit;
        }
        $this->assign('admin',$this->_admin);
        //判断用户是否有相应模块访问的权限
        $this->db = new Sysdb();
    }
}